<div id="dataset" class="dataset-entity-header">
  <div class="container">
    {{datasets/urn-breadcrumbs class="nacho-breadcrumbs nacho-breadcrumbs--white-surface" urn=model.uri}}

    <div class="row">
      <div class="container">
        <div class="dataset-meta-properties">
          <h3 class="dataset-name">
            {{model.nativeName}}
          </h3>

          {{#if model.removed}}
            <span class="removed-dataset dataset-pill">
              REMOVED

              {{tooltip-on-element
                event="hover"
                text="This dataset has been removed"
              }}
            </span>
          {{/if}}

          {{#if datasetContainsPersonalData}}
            <span class="pii-dataset dataset-pill">
              PII

              {{tooltip-on-element
                event="hover"
                side="right"
                text="This dataset contains personally identifiable information"
              }}
            </span>

          {{/if}}

          {{#if model.deprecated}}

            <span class="deprecated-dataset dataset-pill">
              {{#link-to "datasets.dataset.properties" encodedUrn}}
                DEPRECATED

                {{tooltip-on-element
                  event="hover"
                  text="Click to view dataset properties"
                }}
              {{/link-to}}
            </span>

          {{/if}}
        </div>

        <div class="dataset-header-meta">
          {{#datasets/containers/dataset-fabrics class="dataset-fabric-row-container" urn=model.uri as |fabricsContainer|}}
            <div class="dataset-fabric-entity-container">
              <strong>Fabric:</strong> {{datasets/dataset-fabric-switcher urn=fabricsContainer.urn }}
            </div>
          {{/datasets/containers/dataset-fabrics}}

          {{#link-to "datasets.dataset.health" encodedUrn}}
            {{datasets/containers/health-score-gauge urn=encodedUrn wikiLinks=wikiLinks}}
          {{/link-to}}
        </div>

        {{datasets/containers/dataset-owner-list
          urn=encodedUrn
          avatarEntityProps=avatarEntityProps}}
      </div>
    </div>

  </div>
</div>

{{#ivy-tabs selection=tabSelected as |tabs|}}
  <div class="dataset-entity-tabs">
    <div class="container">
      {{#tabs.tablist as |tablist|}}

        {{#unless isPinot}}
          {{#tablist.tab tabIds.Properties on-select=(action "tabSelectionChanged")}}
            Status
          {{/tablist.tab}}
        {{/unless}}

        {{#tablist.tab tabIds.Access on-select=(action "tabSelectionChanged")}}ACL Access{{/tablist.tab}}

        {{#tablist.tab tabIds.Schema on-select=(action "tabSelectionChanged")}}Schema{{/tablist.tab}}

        {{#tablist.tab tabIds.Ownership on-select=(action "tabSelectionChanged")}}
          Ownership

          {{#if ownershipRequiresUserAction}}
            <span class="notification-dot notification-dot--on-tab" aria-hidden="true"></span>
          {{/if}}
        {{/tablist.tab}}

        {{#if isInternal}}
          {{#tablist.tab tabIds.Compliance on-select=(action "tabSelectionChanged")}}
            Compliance

            {{#if requiresUserAction}}
              <span class="notification-dot notification-dot--on-tab" aria-hidden="true"></span>
            {{/if}}
          {{/tablist.tab}}
        {{/if}}

        {{#if shouldShowDatasetLineage}}
          {{#tablist.tab tabIds.Relationships on-select=(action "tabSelectionChanged")}}
            Relationships
          {{/tablist.tab}}
        {{/if}}

        {{#tablist.tab tabIds.Health on-select=(action "tabSelectionChanged")}}
          Health
        {{/tablist.tab}}

      {{/tabs.tablist}}
    </div>
  </div>

  <div class="container">
    {{#tabs.tabpanel tabIds.Properties}}
      {{datasets/containers/dataset-properties
        urn=encodedUrn
        deprecated=model.deprecated
        deprecationNote=model.deprecationNote
        wikiLinks=wikiLinks
      }}
    {{/tabs.tabpanel}}

    {{#tabs.tabpanel tabIds.Comments}}
    {{/tabs.tabpanel}}

    {{#tabs.tabpanel tabIds.Schema}}
      {{datasets/containers/dataset-schema urn=encodedUrn}}
    {{/tabs.tabpanel}}

    {{#tabs.tabpanel tabIds.Ownership}}
      {{datasets/containers/dataset-ownership
        urn=encodedUrn
        setOwnershipRuleChange=(action "setOwnershipRuleChange")}}
    {{/tabs.tabpanel}}

    {{#tabs.tabpanel tabIds.Compliance}}
      {{datasets/containers/dataset-compliance
        urn=encodedUrn
        platform=model.platform
        wikiLinks=wikiLinks
        datasetName=model.nativeName
        complianceTagFilter=complianceTagFilter
        notifyPiiStatus=(action "onNotifyPiiStatus")
        setOnChangeSetDrift=(action "setOnChangeSetDrift")
        setOnComplianceType=(action "setOnComplianceTypeChange")
        onComplianceTagFilterChange=(action "onComplianceTagFilterChange")
      }}
    {{/tabs.tabpanel}}

    {{#tabs.tabpanel tabIds.Access}}
      {{datasets/containers/dataset-acl-access
        urn=encodedUrn
        aclMoreInfoLink=wikiLinks.jitAcl
        isJitAclAccessEnabled=isJitAclAccessEnabled
        jitAclContact=jitAclContact
      }}
    {{/tabs.tabpanel}}

    {{#if shouldShowDatasetLineage}}
      {{#tabs.tabpanel tabIds.Relationships}}
        {{datasets/dataset-relationships urn=encodedUrn}}
      {{/tabs.tabpanel}}
    {{/if}}

    {{#tabs.tabpanel tabIds.Health}}
      {{datasets/containers/dataset-health
        urn=encodedUrn
        tabSelected=tabSelected
        shouldShowDatasetHealth=shouldShowDatasetHealth
      }}
    {{/tabs.tabpanel}}
  </div>
{{/ivy-tabs}}
